<template>
    <div class="block">
        <el-timeline>
            <el-timeline-item
                    v-for="(item, index) of timeline"
                    :key="index"
                    :timestamp="item.time"
                    placement="top">
                <el-card style="padding: 0px;">
                    <h4>IP:{{ item.ip }}</h4>
                </el-card>
            </el-timeline-item>
        </el-timeline>
    </div>
</template>

<script lang="ts">
    import {Component} from 'vue-property-decorator'
    import $http from "@/core/utils/http";
    import {API} from "@/core/api/API";
    import {mixins} from "vue-class-component";
    import BaseVue from "@/core/mixin/BaseVue";
    import Kit from "@/core/mixin/Kit";

    @Component({
        name: 'Timeline'
    })
    export default class extends mixins(BaseVue, Kit) {
        private timeline = []

        //初始化
        async mounted() {
            $http.post(API.sysUserLoginTimeline, {}).then((res: any) => {
                if (res.success) {
                    this.timeline = res.data;
                }
            });
        }


    }
</script>


